package indi.yuluo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

/**
 * @Author: yuluo
 * @CreateTime: 2022-07-21  15:24
 * @Description: JedisPool配置类
 */

@Configuration
public class JedisPoolConfiguration extends JedisPoolConfig {


    @Bean
    public JedisPool jedisPool() {

        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
        jedisPoolConfig.setMaxTotal(30);
        jedisPoolConfig.setMinIdle(20);
        jedisPoolConfig.setMaxTotal(100);

        return new JedisPool(jedisPoolConfig, "127.0.0.1", 6379, 18000, "082916");

    }

}
